<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>{:session('cp.cpsysname')}--商户管理平台</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="{:config('webconfig.description');}">
    <meta name="keywords" content="{:config('webconfig.keywords');}">
    <meta name="author" content="runoob">
    <link rel="stylesheet" href="__STATIC_URL__/static/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="__STATIC_URL__/static/css/index.css"/>
    <link rel="stylesheet" type="text/css" href="__STATIC_URL__/static/member/css/core1.css?v=3"/>

    <script src="__STATIC_URL__/static/js/jquery-2.1.4.min.js"></script>
    <script src="__STATIC_URL__/static/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <link rel="stylesheet" type="text/css" href="__STATIC_URL__/static/bootstrap-table/bootstrap-table.css"/>
    <script src="__STATIC_URL__/static/bootstrap-table/bootstrap-table.js"></script>
    <script src="__STATIC_URL__/static/bootstrap-table/bootstrap-table-zh-CN.js"></script>
    <style>
        thead tr th {
            text-align: center;
        }

        tbody tr td {
            text-align: center;
        }
    </style>
</head>
<body>
{include file='public/header'/}
<!------------------导航-------------------------->
<section id="content">
    {include file='public/left'/}
    <!--------------------------主要内容区域------------------------------------->
    <div class="content">
        <div class="page-heading mgl15 mgr15">
            <ul class="breadcrumb">
                <li>当前位置是&nbsp;:</li>
                <li>&nbsp;<a href="#">商户管理</a></li>
                <li ><a href="#">商户列表</a></li>
                <li class="active" style="color: #02b87f;">设备管理</li>

            </ul>
        </div>
        <div class="panel panel-search panel-default mgl15 mgr15">
            <div class="panel-heading">
                <h3 class="panel-title">
                    筛选
                </h3>
            </div>
            <div class="panel-body">
                <form action="" method="get" class="form-horizontal table-search form-search" role="form" id="machform">
                    <div class="col-sm-6 col-md-6 col-lg-4 ">
                        <div class="form-group">
                            <input type="hidden" id="top_mid" value="{$info['id']}">

                            <label class="col-sm-3 control-label">状态：</label>
                            <div class="col-sm-9">
                                <select name="status" id="status" class="form-control" required="required">
                                    <option value="">选择状态</option>
                                    <option value="1">未确认</option>
                                    <option value="2">已确认</option>
                                </select>
                            </div>
                        </div>
                    </div>

                </form>
            </div>
            <div class="panel-footer">
                <a href="javascript:;" class="btn btn-primary" onclick="searchform()">查找</a>
                <a href="javascript:;" class="btn btn-default" onclick="clearform()">清空</a>
            </div>
        </div>
        <div class="panel mgl15 mgr15">

            <div class="panel-heading addCharts" style="background:#ededed;">领取记录列表</div>
            <div class="panel-body">
                <table class="table table-bordered" data-toolbar="#toolbar" id="tablelist">

                </table>
            </div>
        </div>
        {include file='public/footer'/}
    </div>
</section>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document" style="margin-top:320px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">绑定</h4>
            </div>
            <div class="modal-body">
               <div>确认绑定设备吗？</div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" id="btn">确认</button>
            </div>
        </div>
    </div>
</div>
</body>
<script src="__STATIC_URL__/static/js/commen.js" type="text/javascript" charset="utf-8"></script>
<script src="__STATIC_URL__/static/layer/layer.js" type="text/javascript" charset="utf-8"></script>
<script src="/momachtable.js"></script>
<script>

    $(function () {
        var type = "getdevicegl";
        var url = "{:url()}";
        getcolumn(type, url, "tablelist")
    });
    function searchform() {
        $("#tablelist" ).bootstrapTable('refresh');
    }
</script>
<script>
    function bangding(obj){
        var id=$(obj).attr("data-id");
        $("#btn").attr("data-id",id);
        $('#myModal').modal('show')
    }
    $(function(){

        $("#btn").click(function(){
            var id = $("#btn").attr("data-id");

            $.ajax({
                url:"{:url('momachtest/momachappstatu')}",
                type:"post",
                data:{id:id},
                success:function(data){
                    console.log(data);
                    $('#myModal').modal('hide')

                    if(data.code==0){
                        layer.msg("核销成功",{icon:1,time:1000});
                        setTimeout("window.location.reload()",1000)
                        return false;
                    }else{
                        layer.alert(data.message,{icon:7});
                        return false;
                    }
                }
            })
        })
    })
</script>

</html>
